package com.ruoyi.crm.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.crm.mapper.SysGoodsInMapper;
import com.ruoyi.crm.domain.SysGoodsIn;
import com.ruoyi.crm.service.ISysGoodsInService;

/**
 * 进货Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-12-11
 */
@Service
public class SysGoodsInServiceImpl implements ISysGoodsInService 
{
    @Autowired
    private SysGoodsInMapper sysGoodsInMapper;

    /**
     * 查询进货
     * 
     * @param id 进货主键
     * @return 进货
     */
    @Override
    public SysGoodsIn selectSysGoodsInById(Long id)
    {
        return sysGoodsInMapper.selectSysGoodsInById(id);
    }

    /**
     * 查询进货列表
     * 
     * @param sysGoodsIn 进货
     * @return 进货
     */
    @Override
    public List<SysGoodsIn> selectSysGoodsInList(SysGoodsIn sysGoodsIn)
    {
        return sysGoodsInMapper.selectSysGoodsInList(sysGoodsIn);
    }

    /**
     * 新增进货
     * 
     * @param sysGoodsIn 进货
     * @return 结果
     */
    @Override
    public int insertSysGoodsIn(SysGoodsIn sysGoodsIn)
    {
        sysGoodsIn.setCreateTime(DateUtils.getNowDate());
        return sysGoodsInMapper.insertSysGoodsIn(sysGoodsIn);
    }

    /**
     * 修改进货
     * 
     * @param sysGoodsIn 进货
     * @return 结果
     */
    @Override
    public int updateSysGoodsIn(SysGoodsIn sysGoodsIn)
    {
        sysGoodsIn.setUpdateTime(DateUtils.getNowDate());
        return sysGoodsInMapper.updateSysGoodsIn(sysGoodsIn);
    }

    /**
     * 批量删除进货
     * 
     * @param ids 需要删除的进货主键
     * @return 结果
     */
    @Override
    public int deleteSysGoodsInByIds(Long[] ids)
    {
        return sysGoodsInMapper.deleteSysGoodsInByIds(ids);
    }

    /**
     * 删除进货信息
     * 
     * @param id 进货主键
     * @return 结果
     */
    @Override
    public int deleteSysGoodsInById(Long id)
    {
        return sysGoodsInMapper.deleteSysGoodsInById(id);
    }
}
